<template>
  <div>

    <el-row>
      <el-col :span="24">
        <div class="grid-content bg-purple-dark">
          <h2>采购信息详情</h2>
        </div>
      </el-col>
    </el-row>

    <el-card class="box-card">
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>供应商名称:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="grid-content bg-purple-light">
            <span>{{ supplierName }}</span>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
          </div>
        </el-col>
      </el-row>
      <br>
      <p/>
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>采购员:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="grid-content bg-purple-light">
            <span>{{ realName }}</span>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
          </div>
        </el-col>
      </el-row>
      <p/>
      <br>
      <p/>
      <el-row>
        <el-col :span="5" class="labClass">
          <div class="grid-content bg-purple">
            <span>采购时间:</span>
          </div>
        </el-col>
        <el-col :span="16">
          <div class="grid-content bg-purple-light">
            <span>{{ date }}</span>
          </div>
        </el-col>
        <el-col :span="3" class="labClass">
          <div class="grid-content bg-purple">
          </div>
        </el-col>
      </el-row>
      <p/>
      <br>
      <p/>
      <el-row>
        <el-col :span="24"><div class="grid-content bg-purple-dark">
          <el-table
              :data="tableData"
              style="width: 100%">
            <el-table-column
                prop="productBean.productName"
                label="商品名称"
                align="center">
            </el-table-column>
            <el-table-column
                prop="productBean.productFirm"
                label="厂家"
                align="center">
            </el-table-column>
            <el-table-column
                prop="productBean.productSell"
                label="建议销售价"
                align="center">
            </el-table-column>
            <el-table-column
                prop="productBean.productBuyer"
                label="建议采购价"
                align="center">
            </el-table-column>
            <el-table-column
                prop="number"
                label="采购数量"
                align="center">
            </el-table-column>
          </el-table>
        </div></el-col>
      </el-row>
      <p/>

      <el-button type="success" @click="returns">返回</el-button>
    </el-card>

  </div>
</template>

<script>
export default {
  name: "findByPurchaseRecordBeanId",
  data() {
    return {
      tableData:'',

      PurchaseRecordBeanId: 0,
      supplierName:'',
      realName:'',
      date:''
    }
  },
  methods:{
    init(id){
      this.PurchaseRecordBeanId=id
      let params = {
        PurchaseRecordBeanId:id
      }
      this.$axios.get('drp/purchaserecord/findByPurchaseRecordBeanId', {params: params}).then(
          r => {
            console.log(r.data )
            this.supplierName=r.data.supplierBean.supplierName
            this.realName=r.data.userBean.realName
            this.date=r.data.date
            this.tableData=r.data.purchaseRecordDetailBeanList
          }
      )
    },
    returns(){
      location.href="/index"
    }
  }
}
</script>

<style scoped>

</style>